<?php
/**
 *
 *
 * @author Zeon <scplay@gmail.com>
 * @date 2019/5/28 14:35
 * @copyright PanxSoft Inc.
 */

use App\Http\Controllers\WebView\V1\CouponCardController;
use App\Http\Controllers\WebView\V1\CouponTicketController;
use App\Http\Controllers\WebView\V1\WishListController;
use App\Models\User;
use Illuminate\Support\Facades\Route;

Route::group([
    'middleware' => ['LocaleEnv']
], function () {

});

Route::group([
    'middleware' => ['LocaleEnv:'. User::GUARD_NAME , 'AppAuth']
], function () {
    /**
     * @see CouponTicketController
     */
    Route::resource('/coupon-ticket', 'CouponTicketController')
        ->names(CouponTicketController::ROUTES);

    /**
     * @see CouponCardController::patchUse
     */
    Route::patch('/coupon-card-use/{coupon_card_id}', 'CouponCardController@patchUse')
        ->name(CouponCardController::ROUTES['patchUse']);

    /**
     * @see CouponCardController
     */
    Route::resource('/coupon-card', 'CouponCardController')
        ->names(CouponCardController::ROUTES);

    /**
     * @see WishListController
     */
    Route::resource('/wish-list', 'WishListController')
        ->names(WishListController::ROUTES);
});
